package com.example.dataimport.dao;

import com.example.dataimport.model.ColumnMappingBO;
import com.example.dataimport.model.TableMappingBO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ColumnMappingDao {

    @Select("select id, excel_path, table_name from table_mapping where ID = #{id}")
    List<TableMappingBO> getTableByID(@Param("id") String id);

    @Select("select id, excel_path, table_name, name, bak_path from table_mapping")
    List<TableMappingBO> getAllTables();

    @Select("select ID, table_id, excel_column, table_column from column_mapping where table_ID = #{table_id}")
    List<ColumnMappingBO> getColumnMappingByTableID(@Param("table_id") String table_id);

}
